<?
/*
 *   Pmail easy way to send emails
 *   Copyright (C) 2009  Felipe Theodoro Gonçalves (www.ftgoncalves.com)
 *
 *   This program is free software: you can redistribute it and/or modify
 *	 it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
?>
<div id="page">
<p class="ind"><?= $html->link(__d('pmail', 'Send email', true), array('plugin' => 'pmail', 'controller' => 'mails', 'action' => 'index')); ?> > <?= __d('pmail', 'Create a email') ?></p>
	<h2><?= __d('pmail', 'Create a email') ?></h2>
	<? if(isset($this->params['pass'][0])): ?>
		<form action="<?= $html->url(array('plugin' => 'pmail', 'controller' => 'mails', 'action' => 'save_mail', 'id' => $this->params['pass'][0])) ?>" method="post" enctype="application/x-www-form-urlencoded">
	<? else: ?>
		<form action="<?= $html->url(array('plugin' => 'pmail', 'controller' => 'mails', 'action' => 'save_mail')) ?>" method="post" enctype="application/x-www-form-urlencoded">
	<? endif; ?>
		<fieldset>
			<legend><?= __d('pmail', 'data of new email') ?></legend>
			<p>
				<label for="identifier"><?= __d('pmail', 'Identifier') ?></label>
				<br/>
				<?= $form->text('Mail.identifier', array('class' => 'middle', 'maxlength' => 10)); ?>
			</p>
			<p>
				<label for="subject"><?= __d('pmail', 'Subject') ?></label>
				<br/>
				<?= $form->text('Mail.subject', array('class' => 'big', 'maxlength' => 40)); ?>
			</p>
			<p>
				<label for="from"><?= __d('pmail', 'From') ?></label>
				<br/>
				<?= $form->text('Mail.from', array('class' => 'big', 'maxlength' => 80)); ?>
			</p>
			<p>
				<label for="layers"><?= __d('pmail', 'Layer') ?></label>
				<br/>
				<?= $form->select('Mail.layer', $layers, null, array('size' => 6, 'class' => 'select_big'), false) ?>
			</p>
			<p>
				<label for="message"><?= __d('pmail', 'Message') ?> - HTML</label>
				<br/>
				<?= $form->textarea('Mail.message'); ?>
			</p>
			<p>
				<label for="signature"><?= __d('pmail', 'Signature') ?></label>
				<br/>
				<?= $form->textarea('Mail.signature', array('rows' => 5, 'cols' => 50)) ?>
			</p>
			<p>
				<?= $form->submit(__d('pmail', 'save', true), array('value' => 'Save', 'class' => 'button')) ?>
			</p>
		</fieldset>
	</form>
</div>
<div id="sidebar">
	<h4><?= __d('pmail', 'Coments') ?></h4>
	<p><?= __d('pmail', 'Compose the content of e-mail') ?>.</p>
	<?= $this->requestAction('/pmail/mails/menu'); ?>
	<?= $this->renderElement('recommended/links'); ?>
</div>
<div class="clear"></div>
<?= $this->renderElement('panel/fckeditor', array('name' => 'data[Mail][message]')); ?>